package com.b.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 用户登录/权限表
 */
@Document(indexName = "userauth")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAuth {
    /**
     * 用户ID
     */
    @Id
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer userId;

    /**
     * 加密后密码
     */
    @Field(type = FieldType.Text, index = false , store = true)
    private String passwordHash;

    /**
     * 邮箱
     */
    @Field(type = FieldType.Text, index = false , store = true)
    private String email;

    /**
     * 手机号
     */
    @Field(type = FieldType.Text, index = true , store = true)
    private String phone;

    /**
     * 状态（正常/封禁）
     */
    @Field(type = FieldType.Text, index = false , store = true)
    private String status;

    /**
     * 真实姓名
     */
    @Field(type = FieldType.Text, index = true , store = true)
    private String name;
}